<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="*|/"><xsl:apply-templates/></xsl:template>

<xsl:template match="text()|@*"><xsl:value-of select="."/></xsl:template>

<xsl:template match='nbsp' name='nbsp'>
<xsl:text disable-output-escaping='yes'>&amp;nbsp;</xsl:text>
</xsl:template>

<xsl:template match="Registration">

<!-- Insert appropriate Validation -->

<script>
function validateForm() {
document.returnValue = true;
<xsl:for-each select="Question">
	<xsl:if test='@Type!="8"'>
		<xsl:if test='@Type="3"'>
			var ric = document.getElementById("R5").value;
			var che = document.getElementById("R5").checked;
			if( ric=="894" )
			if( che==false ) {
				var gg = document.getElementById("gg<xsl:value-of select="@ID"/>").value;
				var mm = document.getElementById("mm<xsl:value-of select="@ID"/>").value;
				var aa = document.getElementById("aaaa<xsl:value-of select="@ID"/>").value
				if (isDate(	gg, mm, aa)){
	//				alert("Bravo hai inserito una data di nascita valida!");
					document.returnValue = true;
				}else{
					alert("Inserisci una data dell'evento valida, dai!");
					document.returnValue = false;
				}
			}
		</xsl:if>

		<xsl:if test='@Type="11"'>
			isUsername(document.getElementById("T<xsl:value-of select="@ID"/>").value);
		</xsl:if>

	</xsl:if>
</xsl:for-each>
}
</script>
<!-- End of Insert appropriate Validation -->

<table class="gbox" border="0" cellspacing="8" cellpadding="0" width="100%">
<form name="formRegistration" method="post" action="{@action}?activityId={/Registration/@activityid}" onSubmit="validateForm();return document.returnValue">
<tr>
<input type="hidden" name="FORM_ID" value="{concat('FORM',@ID)}"></input>
<input type="hidden" name="FORUMID" value="{/Registration/@forumid}"></input>
<td colspan="4">
</td>
</tr>

<xsl:apply-templates/>

</form>
</table>
</xsl:template>

<xsl:template match="box">
		<tr><td colspan="4" align="left">
<table class="gbox" border="0" cellspacing="8" cellpadding="0" width="100%">
	<xsl:apply-templates/>
</table>
		</td></tr>
</xsl:template>

<xsl:template match="Question">
<xsl:choose>
	<xsl:when test='@Type="16"'>
		<xsl:variable name="next">
			<xsl:value-of select="@P1"/>
		</xsl:variable>
	</xsl:when>
	<xsl:when test='@Type="15"'>
		<tr><td colspan="4" align="center">
		<a href="{@P3}"><xsl:value-of select="@Description"/></a>
		<br/><span class="body_10px_red"><xsl:value-of select="@Comment"/></span>
		</td></tr>
	</xsl:when>
	<xsl:when test='@Type="14"'>
		<tr><td colspan="4" align="center">
		<input id="SB{@ID}" name="SB{@ID}" onClick="javascript:link('{@P3}');" type="button" value="{@Description}"></input>
		<br/><span class="body_10px_red"><xsl:value-of select="@Comment"/></span>
		</td></tr>
	</xsl:when>
	<xsl:when test='@Type="8"'>
		<tr><td colspan="4" align="center">
			<input type="submit" name="{concat('SUBMIT',@ID)}" value="{@Description}"></input><br/>
		</td></tr>
	</xsl:when>
	<xsl:when test='@Type="9"'>
		<tr><td colspan="4" align="center"><h4><xsl:value-of select="@Description"/></h4></td></tr>
	</xsl:when>
	<xsl:when test='@Type="10" and @P1="0"'>
		<tr><td colspan="4" align="left"><xsl:value-of select="@Comment"/></td></tr>
		<tr><td colspan="4" align="left"></td></tr>
	</xsl:when>
	<xsl:when test='@Type="10" and @P1="1"'>
		<tr>
		<td width="200px"><xsl:value-of select="@Description"/></td>
		<td align="right"></td>
		<td></td>
		<td><xsl:value-of select="@Comment"/></td></tr>
		<tr><td colspan="4" align="left"></td></tr>
	</xsl:when>
	<xsl:when test='@Type="41"'>
		<tr>
		<td width="200px"><xsl:value-of select="@Description"/></td>
		<td align="right"></td>
		<td></td>
		<td><img src="/imgs/girl.gif"/>&#160;<input type="text" name="{concat('T',@ID)}" size="5" maxlength="5" value="{/Registration/@mprice}"></input>&#160;<input onchange="document.forms[0].{concat('T',@ID)}.disabled=document.forms[0].{concat('CB',@ID)}.checked" type="checkbox" name="{concat('CB',@ID)}">Free</input></td>
		</tr>
	</xsl:when>
	<xsl:when test='@Type="42"'>
		<tr>
		<td width="200px"><xsl:value-of select="@Description"/></td>
		<td align="right"></td>
		<td></td>
		<td><img src="/imgs/boy.gif"/>&#160;<input type="text" name="{concat('T',@ID)}" size="5" maxlength="5" value="{/Registration/@fprice}"></input>&#160;<input onchange="document.forms[0].{concat('T',@ID)}.disabled=document.forms[0].{concat('CB',@ID)}.checked" type="checkbox" name="{concat('CB',@ID)}">Free</input></td>
		</tr>
	</xsl:when>

	<xsl:when test='@Type="2" and @ID="14"'>
		<tr>
		<td width="200px">
		<div style="float:left;"><img src="/imgs/argh.gif"/></div><div style="padding-top:6px;"><xsl:value-of select="@Description"/></div>
		</td>
		<td align="right"></td>
		<td></td>
		<td>
		<table>
		<xsl:variable name="radioID" select="concat('R',@ID)"></xsl:variable>

		<xsl:choose>
		<xsl:when test='@P1="1"'>
			<tr>
			<xsl:for-each select="Answer">
				<xsl:choose>
				  <xsl:when test='@Selected="1"'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
				  <xsl:when test='@Selected="0"'><td><input type="radio" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
				</xsl:choose>
				<td class="body"><xsl:value-of select="."/></td>
			</xsl:for-each>
			</tr>
		</xsl:when>
		<xsl:when test='@P1="2"'>
			<xsl:for-each select="Answer">
				<tr>
					<xsl:choose>
					  <xsl:when test='@Selected="1"'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
					  <xsl:when test='@Selected="0"'><td><input type="radio" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
					</xsl:choose>
				<td class="body"><xsl:value-of select="."/></td>
				</tr>
			</xsl:for-each>
		</xsl:when>
		</xsl:choose>

		</table>
		</td>
		</tr>
	</xsl:when>
	<xsl:when test='@Type="X2" and @ID="21"'>
		<tr>
		<td width="200px">
		<div style="padding-top:6px;"><xsl:value-of select="@Description"/></div>
		</td>
		<td align="right"></td>
		<td></td>
		<td>
		<table>
		<xsl:variable name="radioID" select="concat('R',@ID)"></xsl:variable>

		<xsl:choose>
		<xsl:when test='@P1="1"'>
			<tr>
			<xsl:for-each select="Answer">
				<xsl:choose>
				  <xsl:when test='@Selected="1"'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
				  <xsl:when test='@Selected="0"'><td><input type="radio" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
				</xsl:choose>
				<td class="body"><xsl:value-of select="."/></td>
			</xsl:for-each>
			</tr>
		</xsl:when>
		<xsl:when test='@P1="2"'>
			<xsl:for-each select="Answer">
				<tr>
					<xsl:choose>
					  <xsl:when test='@Selected="1"'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
					  <xsl:when test='@Selected="0"'><td><input type="radio" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
					</xsl:choose>
				<td class="body"><xsl:value-of select="."/></td>
				</tr>
			</xsl:for-each>
		</xsl:when>
		</xsl:choose>

		</table>
		</td>
		</tr>
		<tr>
		<td colspan="2" width="200px"><div style="float:left;"><img src="/imgs/banner/{/Registration/@banner}"/></div>
		<input type="hidden" name="BANNER" value="{/Registration/@banner}"></input>
		</td>
		</tr>
	</xsl:when>
	<xsl:when test='@Type="X1"'>
		<tr>
		<td width="200px"><xsl:value-of select="@Description"/></td>
		<td align="right"></td>
		<td></td>
		<td>
			<xsl:choose>
				<xsl:when test='/Registration/@lid'>
				<input type="hidden" name="LID" value="{/Registration/@lid}"></input>
				<div style="float:left;"><input type="text" name="{concat('T',@ID)}" size="22" maxlength="255" disabled="true" value="{/Registration/@name}"></input></div>
					<div style="float:left;padding-top:4px;">&#160;&#160;(<a href="?activityId={/Registration/@activityid}&amp;chooselid=1">Cambia locale!</a>)</div>
					<div style="padding-top:2px;">&#160;&#160;<a href="?activityId={/Registration/@activityid}&amp;nukelid=1"><img border="0" src="/imgs/delete.gif"/></a></div>
				</xsl:when>
				<xsl:otherwise>
				<input type="text" name="{concat('T',@ID)}" size="22" maxlength="255" disabled="true" value="Nessun locale selezionato!"></input>
					&#160;(<a href="?activityId={/Registration/@activityid}&amp;chooselid=1">Seleziona un locale!</a>)
				</xsl:otherwise>
			</xsl:choose>
		</td>
		</tr>
	</xsl:when>

	<xsl:when test='@Type="3"'>
		<tr>
		<td width="200px"><xsl:value-of select="@Description"/></td>
		<td align="right"></td>
		<td></td>
		<td>
		<nobr>
		<input type="text" id="{concat('gg',@ID)}" name="{concat('gg',@ID)}" class="form" size="2" maxlength="2" value="{/Registration/@gg}"></input>
		/
		<input type="text" id="{concat('mm',@ID)}" name="{concat('mm',@ID)}" class="form" size="2" maxlength="2" value="{/Registration/@mm}"></input>
		/
		<input type="text" id="{concat('aaaa',@ID)}" name="{concat('aaaa',@ID)}" class="form" size="4" maxlength="4" value="{/Registration/@aaaa}"></input>
		&#160;<span class="body_10px_red"><xsl:value-of select="@Comment"/></span></nobr>
		</td>
		</tr>
	</xsl:when>

	<xsl:when test='@Type="31"'>
		<tr>
		<td width="200px"><xsl:value-of select="@Description"/></td>
		<td align="right"></td>
		<td></td>
		<td>
		<nobr>
			<xsl:choose>
				<xsl:when test='string-length(/Registration/@hh)=1'>
					<input type="text" id="{concat('hh',@ID)}" name="{concat('hh',@ID)}" class="form" size="2" maxlength="2" value="{concat('0',/Registration/@hh)}"></input>
				</xsl:when>
				<xsl:otherwise>
					<input type="text" id="{concat('hh',@ID)}" name="{concat('hh',@ID)}" class="form" size="2" maxlength="2" value="{/Registration/@hh}"></input>
				</xsl:otherwise>
			</xsl:choose>
		:
			<xsl:choose>
				<xsl:when test='string-length(/Registration/@mi)=1'>
					<input type="text" id="{concat('mi',@ID)}" name="{concat('mi',@ID)}" class="form" size="2" maxlength="2" value="{concat('0',/Registration/@mi)}"></input>
				</xsl:when>
				<xsl:otherwise>
					<input type="text" id="{concat('mi',@ID)}" name="{concat('mi',@ID)}" class="form" size="2" maxlength="2" value="{/Registration/@mi}"></input>
				</xsl:otherwise>
			</xsl:choose>
		</nobr>
		<div class="body_10px_red"><xsl:value-of select="@Comment"/></div>
		</td>
		</tr>
	</xsl:when>

	<xsl:when test='@Type="2" and @ID="15"'>
		<tr>
		<td width="200px"><xsl:value-of select="@Description"/></td>
		<td align="right"></td>
		<td></td>
		<td>
		<table>
		<xsl:variable name="radioID" select="concat('R',@ID)"></xsl:variable>

		<xsl:choose>
		<xsl:when test='@P1="1"'>
			<tr>
			<xsl:for-each select="Answer">
				<xsl:choose>
				  <xsl:when test='@ID=2190 and (floor( /Registration/@settings div 16 ) mod 2)'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
				  <xsl:when test='@ID=2191 and 1 != (floor( /Registration/@settings div 16 ) mod 2)'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
				  <xsl:otherwise><td><input type="radio" value="{@ID}" name="{$radioID}"></input></td></xsl:otherwise>
				</xsl:choose>
				<td class="body"><xsl:value-of select="."/></td>
			</xsl:for-each>
			</tr>
		</xsl:when>
		<xsl:when test='@P1="2"'>
			<xsl:for-each select="Answer">
				<tr>
					<xsl:choose>
					  <xsl:when test='@ID=/Registration/@radio'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
					  <xsl:otherwise><td><input type="radio" value="{@ID}" name="{$radioID}"></input></td></xsl:otherwise>
					</xsl:choose>
				<td class="body"><xsl:value-of select="."/></td>
				</tr>
			</xsl:for-each>
		</xsl:when>
		</xsl:choose>

		</table>
		</td>
		</tr>
	</xsl:when>

	<xsl:when test='@Type="2" and @ID="16"'>
		<tr>
		<td width="200px"><xsl:value-of select="@Description"/></td>
		<td align="right"></td>
		<td></td>
		<td>
		<table>
		<xsl:variable name="radioID" select="concat('R',@ID)"></xsl:variable>

		<xsl:choose>
		<xsl:when test='@P1="1"'>
			<tr>
			<xsl:for-each select="Answer">
				<xsl:choose>
				  <xsl:when test='@ID=2190 and (floor( /Registration/@settings div 8 ) mod 2)'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
				  <xsl:when test='@ID=2191 and 1 != (floor( /Registration/@settings div 8 ) mod 2)'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
				  <xsl:otherwise><td><input type="radio" value="{@ID}" name="{$radioID}"></input></td></xsl:otherwise>
				</xsl:choose>
				<td class="body"><xsl:value-of select="."/></td>
			</xsl:for-each>
			</tr>
		</xsl:when>
		<xsl:when test='@P1="2"'>
			<xsl:for-each select="Answer">
				<tr>
					<xsl:choose>
					  <xsl:when test='@ID=/Registration/@radio'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
					  <xsl:otherwise><td><input type="radio" value="{@ID}" name="{$radioID}"></input></td></xsl:otherwise>
					</xsl:choose>
				<td class="body"><xsl:value-of select="."/></td>
				</tr>
			</xsl:for-each>
		</xsl:when>
		</xsl:choose>

		</table>
		</td>
		</tr>
	</xsl:when>
			<xsl:when test='@Type="2" and @ID="29"'>
				<tr>
					<td width="200px"><xsl:value-of select="@Description"/></td>
					<td align="right"></td>
					<td></td>

					<td>
						<table>
							<xsl:variable name="radioID" select="concat('R',@ID)"></xsl:variable>

							<xsl:choose>
							<xsl:when test='@P1="1"'>
								<tr>
								<xsl:for-each select="Answer">
									<xsl:choose>
									  <xsl:when test='@ID=2190 and (floor( /Registration/@settings div 16384 ) mod 2)'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
									  <xsl:when test='@ID=2191 and 1 != (floor( /Registration/@settings div 16384 ) mod 2)'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
									  <xsl:otherwise><td><input type="radio" value="{@ID}" name="{$radioID}"></input></td></xsl:otherwise>
									</xsl:choose>
									<td class="body"><xsl:value-of select="."/></td>
								</xsl:for-each>
								</tr>
							</xsl:when>
							<xsl:when test='@P1="2"'>
								<xsl:for-each select="Answer">
									<tr>
										<xsl:choose>
										  <xsl:when test='@ID=/Registration/@radio'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
										  <xsl:otherwise><td><input type="radio" value="{@ID}" name="{$radioID}"></input></td></xsl:otherwise>
										</xsl:choose>
									<td class="body"><xsl:value-of select="."/></td>
									</tr>
								</xsl:for-each>
							</xsl:when>
							</xsl:choose>

						</table>
					</td>
				</tr>
			</xsl:when>

			<xsl:when test='@Type="2" and @ID="28"'>
				<tr>
				<td width="200px"><xsl:value-of select="@Description"/></td>
				<td align="right"></td>
				<td></td>
				<td>
				<table>
				<xsl:variable name="radioID" select="concat('R',@ID)"></xsl:variable>

				<xsl:choose>
				<xsl:when test='@P1="1"'>
					<tr>
					<xsl:for-each select="Answer">
						<xsl:choose>
						  <xsl:when test='@ID=2190 and (floor( /Registration/@settings div 8192 ) mod 2)'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
						  <xsl:when test='@ID=2191 and 1 != (floor( /Registration/@settings div 8192 ) mod 2)'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
						  <xsl:otherwise><td><input type="radio" value="{@ID}" name="{$radioID}"></input></td></xsl:otherwise>
						</xsl:choose>
						<td class="body"><xsl:value-of select="."/></td>
					</xsl:for-each>
					</tr>
				</xsl:when>
				<xsl:when test='@P1="2"'>
					<xsl:for-each select="Answer">
						<tr>
							<xsl:choose>
							  <xsl:when test='@ID=/Registration/@radio'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
							  <xsl:otherwise><td><input type="radio" value="{@ID}" name="{$radioID}"></input></td></xsl:otherwise>
							</xsl:choose>
						<td class="body"><xsl:value-of select="."/></td>
						</tr>
					</xsl:for-each>
				</xsl:when>
				</xsl:choose>

				</table>
				</td>
				</tr>
		</xsl:when>

	<xsl:when test='@Type="2" and @ID="20"'>
		<tr>
		<td width="200px"><xsl:value-of select="@Description"/></td>
		<td align="right"></td>
		<td></td>
		<td>
		<table>
		<xsl:variable name="radioID" select="concat('R',@ID)"></xsl:variable>

		<xsl:choose>
		<xsl:when test='@P1="1"'>
			<tr>
			<xsl:for-each select="Answer">
				<xsl:choose>
				  <xsl:when test='@ID=2190 and (floor( /Registration/@settings div 32 ) mod 2)'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
				  <xsl:when test='@ID=2191 and 1 != (floor( /Registration/@settings div 32 ) mod 2)'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
				  <xsl:otherwise><td><input type="radio" value="{@ID}" name="{$radioID}"></input></td></xsl:otherwise>
				</xsl:choose>
				<td class="body"><xsl:value-of select="."/></td>
			</xsl:for-each>
			</tr>
		</xsl:when>
		<xsl:when test='@P1="2"'>
			<xsl:for-each select="Answer">
				<tr>
					<xsl:choose>
					  <xsl:when test='@ID=/Registration/@radio'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
					  <xsl:otherwise><td><input type="radio" value="{@ID}" name="{$radioID}"></input></td></xsl:otherwise>
					</xsl:choose>
				<td class="body"><xsl:value-of select="."/></td>
				</tr>
			</xsl:for-each>
		</xsl:when>
		</xsl:choose>

		</table>
		</td>
		</tr>
	</xsl:when>

	<xsl:when test='@Type="2"'>
		<tr>
		<td width="200px"><xsl:value-of select="@Description"/></td>
		<td align="right"></td>
		<td></td>
		<td>
		<table>
		<xsl:variable name="radioID" select="concat('R',@ID)"></xsl:variable>

		<xsl:choose>
		<xsl:when test='@P1="1"'>
			<tr>
			<xsl:for-each select="Answer">
				<xsl:choose>
				  <xsl:when test='@ID=/Registration/@radio'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
				  <xsl:otherwise><td><input type="radio" value="{@ID}" name="{$radioID}"></input></td></xsl:otherwise>
				</xsl:choose>
				<td class="body"><xsl:value-of select="."/></td>
			</xsl:for-each>
			</tr>
		</xsl:when>
		<xsl:when test='@P1="2"'>
			<xsl:for-each select="Answer">
				<tr>
					<xsl:choose>
					  <xsl:when test='@ID=/Registration/@radio'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
					  <xsl:when test='@Selected="1"'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
					  <xsl:otherwise><td><input type="radio" value="{@ID}" name="{$radioID}"></input></td></xsl:otherwise>
					</xsl:choose>
				<td class="body"><xsl:value-of select="."/></td>
				</tr>
			</xsl:for-each>
		</xsl:when>
		</xsl:choose>

		</table>
		</td>
		</tr>
	</xsl:when>


	<xsl:otherwise>
		<tr>
		<td width="200px">
		<xsl:value-of select="@Description"/>
		</td><td align="right">
		</td><td>

		</td>
		<td>

		<xsl:if test='@Type="7"'>
		<xsl:variable name="TMPID" select="@ID"></xsl:variable>
			<xsl:for-each select='Answer'>
			<table cellspacing="0" cellpadding="0">
				<xsl:if test='@Type="4"'>
					<tr><td><input type="text" name='SE{../@ID}' size="35" maxlength="64"></input></td></tr>
				</xsl:if>
				<xsl:if test='@Type="1"'>
					<tr><td>
					<select class="body" size="1" name="{concat('SD',@ID)}">
					<xsl:for-each select="SubAnswer">
					<option value="{@ID}"><xsl:value-of select="."/></option>
					</xsl:for-each>
					</select>
					</td></tr>
				</xsl:if>
			</table>
			</xsl:for-each>
		</xsl:if>

		<xsl:if test='@Type="1" and @ID="2"'>
		<select class="body" size="1" name="D{@ID}">
			<xsl:for-each select="Answer">
				<xsl:choose>
				  <xsl:when test='@ID=/Registration/@categoryid'><option selected="selected" value="{@ID}"><xsl:value-of select="."/></option></xsl:when>
				  <xsl:otherwise><option value="{@ID}"><xsl:value-of select="."/></option></xsl:otherwise>
				</xsl:choose>
			</xsl:for-each>
		</select>
		</xsl:if>

		<xsl:if test='@Type="1" and @ID="18"'>
		<select class="body" size="1" name="D{@ID}">
			<xsl:for-each select="Answer">
				<xsl:choose>
				  <xsl:when test='@ID=/Registration/@lim'><option selected="selected" value="{@ID}"><xsl:value-of select="."/></option></xsl:when>
				  <xsl:otherwise><option value="{@ID}"><xsl:value-of select="."/></option></xsl:otherwise>
				</xsl:choose>
			</xsl:for-each>
		</select>
		</xsl:if>

		<xsl:if test='@Type="1" and @ID="19"'>
		<select class="body" size="1" name="D{@ID}">
			<xsl:for-each select="Answer">
				<xsl:choose>
				  <xsl:when test='@ID=/Registration/@ovb'><option selected="selected" value="{@ID}"><xsl:value-of select="."/></option></xsl:when>
				  <xsl:otherwise><option value="{@ID}"><xsl:value-of select="."/></option></xsl:otherwise>
				</xsl:choose>
			</xsl:for-each>
		</select>
		</xsl:if>

		<xsl:if test='@Type="1" and @ID="27"'>
		<select class="body" size="1" name="D{@ID}">
			<xsl:for-each select="Answer">
				<xsl:choose>
				  <xsl:when test='@ID=1242 and (floor( /Registration/@settings div 2048 ) mod 2)'><option selected="selected" value="{@ID}"><xsl:value-of select="."/></option></xsl:when>
				  <xsl:when test='@ID=1243 and (floor( /Registration/@settings div 4096 ) mod 2)'><option selected="selected" value="{@ID}"><xsl:value-of select="."/></option></xsl:when>
				  <xsl:otherwise><option value="{@ID}"><xsl:value-of select="."/></option></xsl:otherwise>
				</xsl:choose>
			</xsl:for-each>
		</select>
		</xsl:if>

		<xsl:if test='@Type="1" and @ID="26"'>
		<select class="body" size="1" name="D{@ID}">
			<xsl:for-each select="Answer">
				<xsl:choose>
				  <xsl:when test='@ID=2190 and (floor( /Registration/@settings div 1024 ) mod 2)'><option selected="selected" value="{@ID}"><xsl:value-of select="."/></option></xsl:when>
				  <xsl:when test='@ID=2191 and 1 != (floor( /Registration/@settings div 1024 ) mod 2)'><option selected="selected" value="{@ID}"><xsl:value-of select="."/></option></xsl:when>
				  <xsl:otherwise><option value="{@ID}"><xsl:value-of select="."/></option></xsl:otherwise>
				</xsl:choose>
			</xsl:for-each>
		</select>
		</xsl:if>

		<xsl:if test='@Type="1" and @ID="25"'>
		<select class="body" size="1" name="D{@ID}">
			<xsl:for-each select="Answer">
				<xsl:choose>
				  <xsl:when test='@ID=1242 and (floor( /Registration/@settings div 256 ) mod 2)'><option selected="selected" value="{@ID}"><xsl:value-of select="."/></option></xsl:when>
				  <xsl:when test='@ID=1243 and (floor( /Registration/@settings div 512 ) mod 2)'><option selected="selected" value="{@ID}"><xsl:value-of select="."/></option></xsl:when>
				  <xsl:otherwise><option value="{@ID}"><xsl:value-of select="."/></option></xsl:otherwise>
				</xsl:choose>
			</xsl:for-each>
		</select>
		</xsl:if>

		<xsl:if test='@Type="1" and @ID="24"'>
		<select class="body" size="1" name="D{@ID}">
			<xsl:for-each select="Answer">
				<xsl:choose>
				  <xsl:when test='@ID=/Registration/@magemax'><option selected="selected" value="{@ID}"><xsl:value-of select="."/></option></xsl:when>
				  <xsl:otherwise><option value="{@ID}"><xsl:value-of select="."/></option></xsl:otherwise>
				</xsl:choose>
			</xsl:for-each>
		</select>
		</xsl:if>
		<xsl:if test='@Type="1" and @ID="23"'>
		<select class="body" size="1" name="D{@ID}">
			<xsl:for-each select="Answer">
				<xsl:choose>
				  <xsl:when test='@ID=/Registration/@magemin'><option selected="selected" value="{@ID}"><xsl:value-of select="."/></option></xsl:when>
				  <xsl:otherwise><option value="{@ID}"><xsl:value-of select="."/></option></xsl:otherwise>
				</xsl:choose>
			</xsl:for-each>
		</select>
		</xsl:if>
		<xsl:if test='@Type="1" and @ID="22"'>
		<select class="body" size="1" name="D{@ID}">
			<xsl:for-each select="Answer">
				<xsl:choose>
				  <xsl:when test='@ID=/Registration/@fagemax'><option selected="selected" value="{@ID}"><xsl:value-of select="."/></option></xsl:when>
				  <xsl:otherwise><option value="{@ID}"><xsl:value-of select="."/></option></xsl:otherwise>
				</xsl:choose>
			</xsl:for-each>
		</select>
		</xsl:if>
		<xsl:if test='@Type="1" and @ID="21"'>
		<select class="body" size="1" name="D{@ID}">
			<xsl:for-each select="Answer">
				<xsl:choose>
				  <xsl:when test='@ID=/Registration/@fagemin'><option selected="selected" value="{@ID}"><xsl:value-of select="."/></option></xsl:when>
				  <xsl:otherwise><option value="{@ID}"><xsl:value-of select="."/></option></xsl:otherwise>
				</xsl:choose>
			</xsl:for-each>
		</select>
		</xsl:if>

		<xsl:if test='@Type="1" and @ID="4"'>
			<xsl:choose>
				<xsl:when test='/Registration/@lid'>
						<input type="hidden" name="D{@ID}" value="{/Registration/@place}"></input>
						<select disabled="true" class="body" size="1" name="DDD{@ID}">
							<xsl:for-each select="Answer">
								<xsl:choose>
									<xsl:when test='@ID=/Registration/@place'><option selected="selected" value="{@ID}"><xsl:value-of select="."/></option></xsl:when>
									<xsl:otherwise><option value="{@ID}"><xsl:value-of select="."/></option></xsl:otherwise>
								</xsl:choose>
							</xsl:for-each>
						</select>
				</xsl:when>
				<xsl:otherwise>
						<select class="body" size="1" name="D{@ID}">
							<xsl:for-each select="Answer">
								<xsl:choose>
									<xsl:when test='@ID=/Registration/@place'><option selected="selected" value="{@ID}"><xsl:value-of select="."/></option></xsl:when>
									<xsl:otherwise><option value="{@ID}"><xsl:value-of select="."/></option></xsl:otherwise>
								</xsl:choose>
							</xsl:for-each>
						</select>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>

		<xsl:if test='@Type="4"'>
			<input type="text" id="{concat('E',@ID)}" name="{concat('E',@ID)}" size="35" maxlength="64"></input>
			<br/><span class="body_10px_red"><xsl:value-of select="@Comment"/></span>
		</xsl:if>

		<xsl:if test='@Type="PIC"'>
			<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="?activityId={/Registration/@activityid}&amp;banner=1">
			<INPUT style="font-family:tahoma; font-size:9px; color:black;" TYPE="FILE" SIZE="20" NAME="FILE1"></INPUT>
			<p/>
			<INPUT style="font-family:tahoma; font-size:9px; color:black;" TYPE="SUBMIT" VALUE="Invia il banner!"></INPUT>
			</FORM>
		</xsl:if>

		<xsl:if test='@Type="5"'>
			<xsl:choose>
			<xsl:when test='@ID="1"'>
				<input type="text" name="{concat('T',@ID)}" size="{@P2}" maxlength="{@P1}" value="{/Registration/@title}"></input>
			</xsl:when>
			<xsl:when test='@ID="9"'>
			<xsl:choose>
				<xsl:when test='/Registration/@lid'>
					<input type="hidden" name="T{@ID}" value="{/Registration/@address}"></input>
					<input disabled="true" type="text" name="{concat('TTTT',@ID)}" size="{@P2}" maxlength="{@P1}" value="{/Registration/@address}"></input>
				</xsl:when>
				<xsl:otherwise>
					<input type="text" name="{concat('T',@ID)}" size="{@P2}" maxlength="{@P1}" value="{/Registration/@address}"></input>
				</xsl:otherwise>
			</xsl:choose>
			</xsl:when>
			<xsl:when test='@ID="10"'>
			<xsl:choose>
				<xsl:when test='/Registration/@lid'>
					<input type="hidden" name="T{@ID}" value="{/Registration/@mapid}"></input>
					<input disabled="true" type="text" name="{concat('TTTT',@ID)}" size="{@P2}" maxlength="{@P1}" value="{/Registration/@mapid}"></input>
				</xsl:when>
				<xsl:otherwise>
					<input type="text" name="{concat('T',@ID)}" size="{@P2}" maxlength="{@P1}" value="{/Registration/@mapid}"></input>
				</xsl:otherwise>
			</xsl:choose>
			</xsl:when>
			<xsl:otherwise>
				<input type="text" name="{concat('T',@ID)}" size="{@P2}" maxlength="{@P1}"></input>
			</xsl:otherwise>
			</xsl:choose>
			<br/><span class="body_10px_red"><xsl:value-of select="@Comment"/></span>
		</xsl:if>

		<xsl:if test='@Type="11"'>
			<input type="text" ID="T{@ID}" name="NICK{@ID}" size="{@P2}" maxlength="{@P1}"></input>
			<br/><span class="body_10px_red"><xsl:value-of select="@Comment"/></span>
		</xsl:if>

		<xsl:if test='@Type="12"'>
			<input type="password" ID="T{@ID}" name="PW{@ID}" size="{@P2}" maxlength="{@P1}"></input>
			<br/><span class="body_10px_red"><xsl:value-of select="@Comment"/></span>
		</xsl:if>

		<xsl:if test='@Type="13"'>
			<xsl:choose>
			<xsl:when test='@ID="3"'>
				<TEXTAREA id="TA{@ID}" name="TA{@ID}" rows="{@P1}" cols="{@P2}"><xsl:value-of select="/Registration/@descr"/></TEXTAREA>
			</xsl:when>
			<xsl:otherwise>
				<TEXTAREA id="TA{@ID}" name="TA{@ID}" rows="{@P1}" cols="{@P2}"></TEXTAREA>
			</xsl:otherwise>
			</xsl:choose>
			<br/><span class="body_10px_red"><xsl:value-of select="@Comment"/></span>
		</xsl:if>

		<xsl:if test='@Type="6"'>
			<img src="{@Comment}" border="1"/>
		</xsl:if>

		</td>
		</tr>
	</xsl:otherwise>
</xsl:choose>

</xsl:template>

</xsl:stylesheet>